import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/home/index.vue'
import TabBar from '@/components/TabBar.vue'
const routes = [{
        path: '/',
        name: 'home',
        components: {
            default: Home,
            footer: TabBar
        }
    },
    {
        path: '/kind',
        name: 'kind',
        components: () =>
            import ('../views/kind/index.vue'),
        footer: TabBar
    },
    {
        path: '/cart',
        name: 'cart',
        component: () =>
            import ('../views/cart/index.vue'),

    },
    {
        path: '/user',
        name: 'user',
        components: () =>
            import ('../views/user/index.vue'),
        footer: TabBar
    },
    {
        path: '/detail/:id',
        name: 'detail',
        component: () =>
            import ('../views/detail/detail.vue'),
    },
    {
        path: '/order',
        name: 'order',
        component: () =>
            import ('../views/order/order.vue'),
    },
    {
        path: '/success',
        name: 'success',
        component: () =>
            import ('../views/success/index.vue'),
    },
    {
        path: '/orderList',
        name: 'orderList',
        component: () =>
            import ('../views/orderList/index.vue'),
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router